{extend name="layout/layout" /}

{block name="content"}
<link src="__STATIC__/plugins/datatables/datatables.min.css">
<div class="row">
    <div class="col-xs-12">
        <div class="box box-success">
            <div class="box-header with-border">
                <h3 class="box-title">编辑</h3>
            </div>
            <div class="box-body">
                <form class="form-horizontal form" id="povertymember_form">
                    <div class="form-body">
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        所在乡村<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        {$area}
                                        <select class="village hide" ><option value="{$info.villageId}" selected >{$info.villageId}</option></select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        选择村民<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <button class="add-btn form-control" type="button" disabled data-title="添加成员">{$info->member->name}</button>
                                        <input type="hidden" id="objid" name="memberId" value="{$info.memberId}">
                                        <input type="hidden" name="tagId" value="{$tagId}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        贫困属性
                                    </label>
                                    <div class="col-md-9">
                                        {volist name="povertydegree" id="vo"}
                                        <input type="radio"  name="povertydegree" {eq name="info.povertydegree" value="$vo"} checked {/eq} value="{$key}">{$vo}
                                        {/volist}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        致贫原因<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <select class="form-control" name="povertyreason">
                                            <option value="0">请选择</option>{$info.povertyreason}
                                            {volist name="povertyreason" id="vo"}
                                            <option {eq name="info.povertyreason" value="$vo"} selected {/eq} value="{$key}">{$vo}</option>
                                            {/volist}
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        脱贫属性
                                    </label>
                                    <div class="col-md-9">
                                        {volist name="outpoverty" id="vo"}
                                        <input type="radio"  name="outpoverty" {eq name="info.outpoverty" value="$vo"} checked {/eq} value="{$key}">{$vo}
                                        {/volist}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        贫困描述<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <textarea class="form-control" maxlength="40" placeholder="最多输入40字" data-required="1"  rows="3" cols="20" name="description" >{$info.description}</textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        人均收入（元）<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="number" class="form-control" data-required="1" name="perincome" value="{$info.perincome}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        家庭人口数<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control" data-required="1" name="familymember" value="{$info.familymember}" maxlength="2" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        与户主关系<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" maxlength="6" class="form-control" data-required="1" name="relation" value="{$info.relation}" maxlength="10">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        住房面积（单位：平米）<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="number" class="form-control" data-required="1" name="housearea" value="{$info.housearea}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        耕地面积（单位：亩）<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="number" class="form-control" data-required="1" name="farmlandarea" value="{$info.farmlandarea}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        是否纳入低保
                                    </label>
                                    <div class="col-md-9">
                                        <input type="radio"  name="isLowInsurance" {eq name="info.isLowInsurance" value="1"} checked {/eq} value="1">是
                                        <input type="radio"  name="isLowInsurance" {eq name="info.isLowInsurance" value="2"} checked {/eq} value="2">否
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        是否参加养老保险
                                    </label>
                                    <div class="col-md-9">
                                        <input type="radio"  name="isJoinPension" {eq name="info.isJoinPension" value="1"} checked {/eq} value="1">是
                                        <input type="radio"  name="isJoinPension" {eq name="info.isJoinPension" value="2"} checked {/eq} value="2">否
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        是否参加新农舍（新型农村合作医疗）
                                    </label>
                                    <div class="col-md-9">
                                        <input type="radio"  name="isJoinNewFarmhouse" {eq name="info.isJoinNewFarmhouse" value="1"} checked {/eq} value="1">是
                                        <input type="radio"  name="isJoinNewFarmhouse" {eq name="info.isJoinNewFarmhouse" value="2"} checked {/eq} value="2">否
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        脱贫或计划脱贫年份<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <input type="text" minlength="4" maxlength="4" placeholder="2025" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" class="form-control" id="outPovertyYear" name="outPovertyYear" value="{$info.outPovertyYear}">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        帮扶计划<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        {volist name="aidingplan" id="vo"}
                                        <input type="checkbox" name="aidingPlan"  {in name="key" value="$info.aidingPlan"}checked{/in} value="{$key}">{$vo}
                                        {/volist}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-9">
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        选择帮扶人<span class="required">*</span>
                                    </label>
                                    <div class="col-md-9">
                                        <button class="add-btn-aid form-control" type="button"  data-title="选择帮扶人">{$info->memberaid->name}</button>
                                        <input type="hidden" name="aidingId" value="{$info.aidingId}">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="form-actions">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label class="col-md-3 control-label"></label>
                                        <div class="col-md-9">
                                            <input type="hidden" name="id" value="{$info.id}">
                                            <button type="button" class="btn btn-primary" id="form-submit">
                                                保存 <i class="fa fa-floppy-o"></i>
                                            </button>
                                            <button type="button" class="btn btn-default" onclick="history.go(-1);">
                                                返回 <i class="fa fa-mail-forward"></i>
                                            </button>
                                            <span class="help-block"></span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="pagescript"}
<script src="__STATIC__/plugins/datatables/datatables.min.js" type="text/javascript"></script>
<script>
    var posturl = "{:url('admin/'.strtolower($model).'/editpost')}";
    var memberlist = "{:url('admin/Layer/memberList')}";
    var memberaidlist = "{:url('admin/Layer/povertyparty')}";
</script>
<script src="__STATIC__/pages/js/povertymember.js" type="text/javascript"></script>
{/block}